package com.jelly.mina.simpleness;

import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IoSession;

public class SamplMinaClientHandler extends IoHandlerAdapter{
	@Override
	public void sessionOpened(IoSession session) throws Exception {
		System.out.println("incomming client:"+session.getRemoteAddress());
		session.write("连接");
	}
	
	@Override
	public void sessionClosed(IoSession session) throws Exception {
		System.out.println("one client Disconnect!");
	}
	
	@Override
	public void messageReceived(IoSession session, Object message)
			throws Exception {
		String s=(String)message;
		System.out.println(s);
		session.write(s);
	}
}	
